/**
 * Created by xuelian on 2018/3/26.
 */
class RecruitPanel extends BasePanel {

    private img_recruit: eui.Image;

    public constructor() {
        super();
        this.skinName = "RecruitPanelSkin";
    }

    childrenCreated() {
        super.childrenCreated();

        this.update();

        this.img_recruit.addEventListener(egret.TouchEvent.TOUCH_TAP, this.clickHandler, this);
    }

    private clickHandler(e: egret.TouchEvent) {
        switch (e.currentTarget) {
            case this.img_recruit:
                if (!GameConfig.recruit_skip || GameConfig.recruit_skip == '') return;

                location.href = GameConfig.recruit_skip;
                break;
        }
    }

    update() {
        this.img_recruit.source = GameConfig.recruit_href + GameConfig.gameType + '.jpg';
    }
}